
<!DOCTYPE html>
<html>
<head>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="theme/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="theme/default/css/common.css">
<script src="theme/default/Js/Common.js"></script>
<script src="theme/default/Js/jquery-3.0.0.min.js"></script>
<script src="theme/default/js/artDialog.js?skin=blue"></script>
<link rel='stylesheet' type="text/css" href='theme/desktop/css/font-awesome.min.css'>
</head>
<body>
<div class="cssout">

  <div class="MenuboxS">
    <ul>
      <li ><span><a href="listmail.html">已发送记录</a></span></li>
      <li class="hover"><span><a href="crm/sms/send1.asp?phone=18978978991&fenlei=手动&moxing=合同&cid=4&xid=2">发送短信</a></span></li>
    </ul>
    <div class="clear"></div>
  </div>

 
</div>
<div class="cssout">
  <div class="allpage">
    <form name="sms" action="?action=send" method="post">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_1">
        <col width="100" />
        <tbody>
          <tr class="tr_t">
            <td class="td_l_l" colspan="2"><b>发送短信</b></td>
          </tr>
          <tr>
            <td class="td_l_r title">收件人 <font color="#FF0000">*</font></td>
            <td class="td_r_l"><input type="text" class="int" name="phone" id="phone" value="18978978991" style="width:60%">
              <span class="info_help" style="cursor:pointer;">&nbsp;手机号码 多个用,分隔</span> 
              <script>function AddReceive() {$.dialog.open('../sms/choosehm.asp?action=receiver', {title: '快速选择', width: 500, height: 300,fixed: true}); };</script></td>
          </tr>
          
          <tr style="display:none;">
            <td class="td_l_r title">分类</td>
            <td class="td_r_l"><input type="text" class="int" name="fenlei" id="fenlei" value="手动" style="width:60%"></td>
          </tr>
          <tr style="display:none;">
            <td class="td_l_r title">模型</td>
            <td class="td_r_l"><input type="text" class="int" name="moxing" id="moxing" value="合同" style="width:60%"></td>
          </tr>
          <tr style="display:none;">
            <td class="td_l_r title">cid</td>
            <td class="td_r_l"><input type="text" class="int" name="cid" id="cid" value="4" style="width:60%"></td>
          </tr>
          <tr style="display:none;">
            <td class="td_l_r title">xid</td>
            <td class="td_r_l"><input type="text" class="int" name="xid" id="xid" value="2" style="width:60%"></td>
          </tr>
          <tr style="display:none;">
            <td class="td_l_r title">队列id</td>
            <td class="td_r_l"><input type="text" class="int" name="did" id="did" value="" style="width:60%"></td>
          </tr>
          
          <tr>
            <td valign="top" class="td_l_r title" style="padding-top:10px;">内容 <font color="#FF0000">*</font></td>
            <td class="td_r_l" style="padding:10px;"><textarea name="content" id="content" class="int" style="width:99%;height:200px;"></textarea></td>
          </tr>
        </tbody>
      </table>
      <div class="h50b"></div>
    <div class="fixed_bg_B">
        <input name="oSender" type="hidden" value="管理员">
        <a class="fasong btn2 btnbaoc" onClick="send()">立即发送</a>
        <input name="Back" type="button" id="Back" class="btn2 btnguanb" value="关闭" onClick="art.dialog.close();guanbi();">
      </div>
    </form>
  </div>
</div>
<script>
function send(){
		
var phone=$("#phone").val();
var content=$("#content").val();
var fenlei=$("#fenlei").val();
var moxing=$("#moxing").val();
var cid=$("#cid").val();
var xid=$("#xid").val();
var did=$("#did").val();
if(phone=="")
  {
	  alert("手机号不能为空");
	  return false;
  }
  
if(content=="")
  {
	  alert("短信内容不能为空");
	  return false;
  }
$(".fasong").html("发送中...")
$(".fasong").addClass("btnbaocno")
$(".fasong").removeClass("btnbaoc")
$(".int").css('background','#F1F1F1')
$(".int").css('cursor','not-allowed')
$(".int").attr('readonly',true);
$(function (){
	 $.ajax({
		 url:"send1_ajax.asp",
		 data:{action:"send",phone:phone,content:content,fenlei:fenlei,moxing:moxing,cid:cid,xid:xid,did:did},
		 dataType:'json',
		 async:true, 
		 type:'post',
		 success:function(data){
		 //alert(data)
		 if(data.code=="10000"){alert("发送成功");$(".fasong").html("发送成功");}else{alert("发送失败，错误码："+ data.code + " 错误原因："+ data.msg);$(".fasong").html("发送失败");}
		 },
		 error:function(XMLHttpRequest, textStatus, errorThrown) {
		   alert(errorThrown);
		   alert("出现未知错误，请联系管理员！");
		 }});
})
  
}
</script>
</body>
</html>
